package bosVM2.meta.Objects;

import bosVM2.FaultHandling.StringEncoderDecoder;
import bosVM2.meta.LookUp.Type;

public class BosField {
	private BosClass clss;
	private String fieldName; 
	private Type type;

	//faulthandling
	StringEncoderDecoder ham = new StringEncoderDecoder();
	public BosField(BosClass clss, String name, Type type)
	{
		this.clss = clss;
		setName(name);
		this.type = type;
	}
 
	public String getName() {
		Object[] temp = ham.deCode(fieldName);
		if((boolean) temp[0]) {
			fieldName = ham.enCode((String) temp[1]);
		}
		return (String) temp[1];
	}
	
	public void setName(String s)
	{	
		fieldName = ham.enCode(s);
	}
	
	public BosClass getBosClass()
	{
		return clss;
	}
	
	public String toString()
	{
		return (String) ham.deCode(fieldName)[1];
	}
	
	public Type getType()
	{
		return type;
	}
	
	//util
	public String getNameI() {
		return fieldName;
	}
	
	public void setNameI(String s)
	{	
		fieldName = s;
	}
}
